package com.franklin.java.api.exception;

import com.intellij.psi.PsiElement;

/**
 * 包装PsiElement的异常
 *
 * @author Franklin
 * @since 2021/9/17 18:07
 */
public class PsiException extends RuntimeException {

    private final PsiElement psiElement;

    private String targetName;

    public PsiException(PsiElement psiElement, String message) {
        super(message);
        this.psiElement = psiElement;
    }

    public PsiException(PsiElement psiElement, String targetName, String message) {
        this(psiElement, message);
        this.targetName = targetName;
    }

    public PsiElement getPsiElement() {
        return psiElement;
    }

    public String getTargetName() {
        return targetName;
    }
}
